package com.googlecode.recycled.drools.camel;

import com.googlecode.recycled.camel.BusinessTransformation;
import com.googlecode.recycled.drools.DroolsTemplate;
import com.googlecode.recycled.lang.assertions.Assert;

public class DroolsBusinessTransformation implements BusinessTransformation {

    protected final DroolsTemplate droolsTemplate;

    public DroolsBusinessTransformation(DroolsTemplate droolsTemplate) {
        this.droolsTemplate = Assert.notNull(droolsTemplate);
    }

    @Override
    public Object transform(Object fact) {
        return droolsTemplate.transformToSingleton(fact);
    }

}
